<!DOCTYPE HTML>
<html>
<HEAD>
<meta charset="utf-8">
<TITLE>员工</TITLE>
</HEAD>
<body>
    
<?php
include_once("base-class.php");

//新建sae数据库类
$mysql = new SaeMysql();

//在职状态
$roster_status_ary=array('','在职','休假','病假','离职');

//获取员工ID号传入
$roster_id=intval($_GET["id"]);



//，进行数据库查询获取全部内容
if($roster_id)
{
	$roster_value=$mysql->getLine("select A.*,B.class_name from roster A left join 
    							class B on A.roster_class=B.class_id where A.roster_id=$roster_id");
    if(!$roster_value)
	{
		echo "<script>alert('无此员工');;</Script>";
		exit;
	}
    else
    {
        $roster_value["roster_sex"]=($roster_value["roster_sex"]==1)?"男":"女";
    
    }
}


?>
    <!--页面名称-->
        <p>
            姓名：<b><?php echo $roster_value["roster_name"];?></b>
        </p>
        <p>
            工号：<b><?php echo $roster_value["roster_number"];?></b>
        </p>
        <p>
            性别：<b><?php echo $roster_value["roster_sex"]?></b>
        </p>
        <p>
            手机：<b><?php echo $roster_value["roster_mp"];?></b>
        </p>
        <p>
            分机：<b><?php echo $roster_value["roster_phone"];?></b>
        </p>
        <p>
            部门：<b><?php echo $roster_value["class_name"];?></b>
        </p>
        <p>
            邮箱：<b><?php echo $roster_value["roster_mail"];?></b>
        </p>
        <p>
            状态：<b><?php echo $roster_status_ary[$roster_value["roster_status"]]?></b>
        </p>
        <p>
            姓名：<b><?php echo $roster_id;?></b>
        </p>    
  
</body>
</html>
